package anveshitha.file.filters;

import java.io.File;

import org.apache.commons.io.filefilter.AbstractFileFilter;

public class NewFileAndSuffixFileFilter extends AbstractFileFilter {
	
	private long modifiedAfter;
	private String suffix;
	
	public NewFileAndSuffixFileFilter(long modifiedAfter, String suffix) {
		super();
		this.modifiedAfter = modifiedAfter;
		this.suffix = suffix;
	}
	
	@Override
	public boolean accept(File file) {
		
		if (file.isFile() && file.canRead() &&
		   file.lastModified() > modifiedAfter &&
		   file.getName().endsWith(suffix)) {
			return true;
		}
			return false;
	}

}
